home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 2 code / Using C++ objects / PtrObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-13  |  753 b   |  39 lines  |  [TEXT/MPS ]

  1. #ifndef __PTROBJECT__
  2. #define __PTROBJECT__
  3.  
  4. #ifndef __TYPES__
  5.     #include <Types.h>
  6. #endif
  7.  
  8. #ifndef __STDDEF__
  9.     #include <stddef.h>
  10. #endif
  11.  
  12. class PtrObject {
  13. public:
  14.     static OSErr    AllocHeap(size_t heapSize);
  15.     // Create a heap heapSize bytes long to
  16.     // allocate objects in.
  17.  
  18.     static void        DisposeHeap();
  19.     // Free up the heap allocated by a previous
  20.     // call to AllocHeap.
  21.  
  22.     static long        FreeMemory();
  23.     // Return the total amount of free space in the heap.
  24.  
  25.     static Size        MaxMemory();
  26.  
  27.     // Return the size of the largest free block in the heap.
  28.  
  29.     void*            operator new(size_t size);
  30.     void            operator delete(void* p);
  31.     // These are our special allocation and
  32.     // deallocation operators.
  33.  
  34. private:
  35.     static THz        fZone;    // Our private zone pointer.
  36. };
  37.  
  38. #endif
  39.